// JavaScript Document

 //menu = "<a href=\"http://www.stanford.edu\">Stanford</a>|<a href=\"http://www.apple.com\">Apple</a>"

var menu = "<a class=\"menuBar\" href=\"settings.php\">Settings</a> | <a class=\"menuBar\" href=\"index.html\">Leave Store</a> | <a class=\"menuBar\" href=\"main_menu.php\">Store Home</a>";

menuShown = true;

function setMenu(item1,item2,item3){
		//menu = item1."|".item2."|".item3;

}


function setMenuShow(value){
	menuShown = value;	
	
	showHideMenu();
}



function showHideMenu(){
	var menuButton = document.getElementById("menuButton");
	
	if(!menuShown){
		showMenu();	
	}
	else {
		hideMenu();	
	}
}

function showMenu(){  
  var menuButton1=document.getElementById("showMenuButton");
  var menuButton2=document.getElementById("hideMenuButton");
  var menuArea1=document.getElementById("menuArea");
  
  menuShown = true;
  //Set menuButton to Hide Menu and display menu
  
   menuButton1.style.visibility = 'hidden';
   menuButton2.style.visibility = "visible";
   menuArea1.innerHTML = menu;
}

function hideMenu(){
   var menuButton1=document.getElementById("showMenuButton");
   var menuButton2=document.getElementById("hideMenuButton");
  var menuArea2=document.getElementById("menuArea");
  
  menuShown = false;
  //Set menuButton to Show Menu and hide menu by setting it to blank
   menuButton1.style.visibility = 'visible';
   menuButton2.style.visibility = 'hidden';
   menuArea2.innerHTML = " ";
}

function getQuerystring(key, default_)
{
  if (default_==null) default_=""; 
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
}